package com.tanhua.dubbo.api;

import com.tanhua.model.mongo.Soul;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;

import java.util.List;

/**
 * @Description:
 * @Create by: wanglei
 * @Date: 2021/11/7 12:50
 */
@DubboService
public class SoulApiImpl implements SoulApi {
    @Autowired
    private MongoTemplate mongoTemplate;
    //查询全部试卷
    @Override
    public List<Soul> selectAll() {
        List<Soul> souls = mongoTemplate.findAll(Soul.class);
        return souls;
    }

    //保存
    @Override
    public void add(Soul soul) {
        mongoTemplate.save(soul);
    }
}
